import { lazy } from "react";

//! 路由写法一： 路由懒加载 lazy();
//! 路由写法二： import 组件名 from "路径";
//! exact 路由精准匹配

// 菜单相关路由
export const menus = [
    { path: "//", exact: true, name: "首页", component: lazy(() => import('@pages/active/active')) },
    { path: "/lotteryWhiteList", exact: true, name: "白名单", component: lazy(() => import('@pages/whitelist/whitelist')), routes: [
        { path: "/lotteryWhiteList/config", name: "设置白名单", component: lazy(() => import('@pages/whitelist/whitelistset')) },
    ]},
    { path: "/createActivity", exact: true, name: "活动", component: lazy(() => import('@pages/active/active')), routes: [
        { path: "/createActivity/add", name: "创建活动", component: lazy(() => import('@pages/active/activeadd')) },
        { path: "/createActivity/detail", name: "活动详情", component: lazy(() => import('@pages/active/activedetail')) },
    ]},
    { path: "/activityComment", exact: true, name: "评论", component: lazy(() => import('@pages/commenton/commenton')) },
];

//登录、首页、404路由
export const main = [
    { path: "/login", exact: true, name: "登录", component: lazy(() => import('@pages/login/login')) },
    { path: "/error", name: "404", component: lazy(() => import('@components/error')) },
];

export const routerExport = {
    main,
    menus,
};